<div class='parent <?php  echo $cquery->parentClass;?>'>
<?php
/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
$catlistC= $pages->getpageCategories();
$isInc =0;$divP="";$pd="";$divS="";
if(count($catlistC)>0){
    $isInc =1;
  
    $divS.="<h4>".($pages->title)."</h4>";
    $divS.= "<ul>";
    for($i=0;$i<count($catlistC);$i++){
           $url =$catlistC[$i]->getURL() ;

$inwhere= $cquery->inWhereList($catlistC[$i]->catid);
        $divS.="<li>
                <a href='".$url."' title='".$catlistC[$i]->category."' $inwhere >  ".$catlistC[$i]->category."</a></li>";
    }
}
echo $divS;
$spagesP= $pages->getsubPage();

if(count($spagesP)>0){
  
    if($isInc==0)
     $divP.="<h4>".($pages->title)."</h4>";
    $divP.="<ul>";
    for($i=0;$i<count($spagesP);$i++){

        $url =$spagesP[$i]->getURL() ;
$inwhere= $cquery->inWhereList($spagesP[$i]->catid);
        $divP.="<li>".
                "<a href='".$url."' title='".$spagesP[$i]->category."' $inwhere >  ".$spagesP[$i]->category."</a></li>";

    } $divP.="</ul>";
}
echo $divP;

if((count($spagesP) < 3 && count($catlistC)< 3 )) {
$row = $pages->getParentPartner();

if($cquery->parentid>14){
$pd = "
    <h4>".($pages->parentName)."</h4>
        <ul>";
 
    for($i=0;$i<count($row);$i++){

$inwhere= $cquery->inWhereList($row[$i]->id);
        $pd.="<li><a href='".$row[$i]->getURL()."' title='".$pages->parentName."  ".$row[$i]->itemname."' $inwhere > ".$row[$i]->itemname."</a>";
        $pd.="
             </li>";
}
$pd.="</ul>
    ";
}
}

echo $pd;
?>
</div>
